package com.ikun.kunpicturebackend.model.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum PictureReviewStatusEnum {

    REVIEWING("待审核", 0),
    PASS("通过", 1),
    REJECT("拒绝", 2);

    private final String text;

    private final Integer value;

    PictureReviewStatusEnum(String text, Integer value) {
        this.text = text;
        this.value = value;
    }

    public static PictureReviewStatusEnum getReviewStatus(Integer value) {
        if (value == null) {
            return null;
        }
        for (PictureReviewStatusEnum pictureReviewStatusEnum : values()) {
            if (Objects.equals(pictureReviewStatusEnum.value, value)) {
                return pictureReviewStatusEnum;
            }
        }
        return null;
    }
}
